package com.crm.jdy.service.drp;

import com.crm.jdy.common.dto.RSaleInfoDto;
import com.crm.jdy.common.mapper.FRecordInfoMapper;
import com.crm.jdy.common.pojo.RSaleInfo;
import com.crm.jdy.common.mapper.RSaleInfoMapper;
import com.crm.jdy.common.pojo.TeamInfo;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**   
 * @Description:(售后管理信息服务实现)
 *
 * @version: V1.0
 * @author: kong
 * 
 */
@Service(version = "${service.version}")
@Component
public class RSaleInfoServiceImpl  extends ServiceImpl<RSaleInfoMapper,RSaleInfo> implements RSaleInfoService  {

    @Autowired
    RSaleInfoMapper rSaleInfoMapper;

    @Override
    public PageInfo<RSaleInfo> seleteRSaleInfo(RSaleInfoDto wOutInfo) {
        PageHelper.startPage( wOutInfo.getCurrentPage(),wOutInfo.getPageSize());
        List<RSaleInfo> bookList = rSaleInfoMapper.seleteRSaleInfo(wOutInfo);
        PageInfo<RSaleInfo> pageInfo = new PageInfo<RSaleInfo>(bookList);
        return pageInfo;
    }

    @Override
    public boolean updateWOutInfo(RSaleInfo wOutInfo) {
        return rSaleInfoMapper.updateById(wOutInfo) > 0;
    }

    @Override
    public boolean addRSaleInfo(RSaleInfo wOutInfo) {
        return rSaleInfoMapper.insert(wOutInfo) > 0;
    }

    @Override
    public boolean removeRSaleInfo(String saleId) {
        return rSaleInfoMapper.deleteById(saleId) > 0;
    }


}